﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Store
{
    public class Bouquet
    {
        private List<Object> flowers = new List<Object>();

        public int getTotalCost()
        {
            int totalcost = 0;

            for (int i = 0; i < flowers.Count(); i++)
            {
                if (flowers.ElementAt(i) is Tulip)
                {
                    Tulip obj = (Tulip)flowers.ElementAt(i);
                    totalcost += obj.getCost();
                }
                else if (flowers.ElementAt(i) is Snowdrop)
                {
                    Snowdrop obj = (Snowdrop)flowers.ElementAt(i);
                    totalcost += obj.getCost();
                }
                else if (flowers.ElementAt(i) is Pansies)
                {
                    Pansies obj = (Pansies)flowers.ElementAt(i);
                    totalcost += obj.getCost();
                }
            }

            return totalcost;
        }

        public void addFlower(Object flower)
        {
            flowers.Add(flower);
        }

        public void removeFlower(int pos)
        {
            flowers.RemoveAt(pos);
        }

        public List<Object> getFlowers()
        {
            return flowers;
        }
    }

    public class Flower
    {
        private string m_title;

        public string Title
        {
            set { m_title = value; }
            get { return m_title; }
        }
    }

    public class Winter : Flower
    {
        private string m_month = "December";
        private int m_cost = 130;

        public string getMonth()
        {
            return m_month;
        }

        public int getCost()
        {
            return m_cost;
        }
    }

    public class Spring : Flower
    {
        private string m_month = "May";
        private int m_cost = 165;

        public string getMonth()
        {
            return m_month;
        }

        public int getCost()
        {
            return m_cost;
        }
    }

    public class Summer : Flower
    {
        private string m_month = "June";
        private int m_cost = 182;

        public string getMonth()
        {
            return m_month;
        }

        public int getCost()
        {
            return m_cost;
        }
    }

    public class Snowdrop : Winter
    {
        private string m_form;

        public string Form
        {
            set { m_form = value; }
            get { return m_form; }
        }
    }

    public class Pansies : Summer
    {
        private string m_form;

        public string Form
        {
            set { m_form = value; }
            get { return m_form; }
        }
    }

    public class Tulip : Spring
    {
        private string m_form;

        public string Form
        {
            set { m_form = value; }
            get { return m_form; }
        }
    }
}
